//
//  CellTripTab.m
//  project-A (pianke)
//
//  Created by dllo on 16/2/1.
//  Copyright © 2016年 scott. All rights reserved.
//

#import "CellTripTab.h"
#import <DKNightVersion.h>
@implementation CellTripTab

-(void)dealloc{
    [_date release];
    [_image release];
    [_name release];
    [super dealloc];
    
}
-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        [self  creatview];
        
        self.name.dk_textColorPicker  = DKColorWithColors([UIColor whiteColor], [UIColor colorWithRed:0.16 green:0.14 blue:0.13 alpha:1]);
        
        
        self.date.dk_textColorPicker  = DKColorWithColors([UIColor whiteColor], [UIColor colorWithRed:0.16 green:0.14 blue:0.13 alpha:1]);
    }
    
    return self;
}

-(void)creatview{
    self.name = [[UILabel alloc]init];
    [self.contentView addSubview:self.name];
    self.name.font = [UIFont fontWithName:@"AmericanTypewriter-Bold" size:22];
        self.name.numberOfLines = 2;
    self.name.textColor = [UIColor whiteColor];
    [self.name release];
    
    
    self.date = [[UILabel alloc]init];
    [self.contentView addSubview:self.date];
    self.date.font = [UIFont fontWithName:@"AmericanTypewriter-Bold" size:12];
    self.date.textColor = [UIColor whiteColor];
    [self.date release];
    
    
    self.image = [[UIImageView alloc]init];
    [self.contentView addSubview:self.image];
    [self.contentView sendSubviewToBack:self.image];
    
    [self.image release];
    
    
}

-(void)layoutSubviews{
    
    [super layoutSubviews];
    CGFloat width = self.contentView.frame.size.width;
    
    self.name.frame = CGRectMake(10, 10, width * 0.7, 40);
    self.date.frame = CGRectMake(10, 65, width * 0.6, 20);
    self.image.frame = CGRectMake(0, 0, width, 0.55 * width);
}



- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
